<template>
  <button @click="toggle">显示隐藏图片</button>
  <img v-show="show" alt="Vue logo" src="./assets/logo.svg" />
  <hr />
  计数器：{{ count }} <button @click="increment">累加</button>
</template>

<script setup>
// ref 就是一个组合式API  
import { ref } from 'vue';

// 显示隐藏
const show = ref(true)
const toggle = () => {
  show.value = !show.value
}

// 计数器
const count = ref(0)
const increment = () => {
  count.value++
}

</script>